package com.css.common.core.enums;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
/**
 * 税费承担方
 */
@Getter
@AllArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SfcdfEnum {

    SWCDF_ZRR("01", "自然人"),

    SWCDF_QY("02", "企业");

    private final String dm;

    private final String mc;

    public static String getMc(String dm) {
        SfcdfEnum res = Arrays.stream(values())
                .filter(x -> x.getDm().equals(dm))
                .findFirst().orElse(null);
        return res == null ? null : res.getMc();
    }
}
